if(upper(word(str, 1)) ~= "TO:") | (upper(word(str, 2)) = "") then
do
call showerror("First headerline wasn't a To: or no address was provided after To:,also, there must be a space after To: and the actual address. Please don't mess with the header IBrowse provides.")
call close(fh)
address command 'c:delete >NIL: 'tempfile''
exit
end
else EVENT.TOADDR = word(str, 2)
str = readln(fh)
if(upper(word(str, 1)) ~= "SUBJECT: ") then
do
call showerror("Second headerline wasn't a Subject: or there was no space left between Subject: and the actual subject text. Please don't mess with the header IBrowse provides.")
call close(fh)
address command 'c:delete >NIL: 'tempfile''
exit
end
else EVENT.SUBJECT = substr(str, 10)
if(upper(word(str, 2)) = "") then
do
call showerror("Mail Discarded by User")
call close(fh)
address command 'c:delete >NIL: 'tempfile''
exit
end
/* put the body of the message in a file with a unique name */
call showerror('No signature configured in either conference, bbs or global settings! Please correct this in THOR or turn off signature adding in IBMailTo.thor.')
call close(fh)
address command 'c:delete >NIL: 'tempfile''
exit
end
else sig = GLOBD.SIGNATURE
end
else sig = BBSD.SIGNATURE
end
else sig = CONFD.SIGNATURE
drop CONFD.; drop BBSD.; drop GLOBD.
if(sig ~= "") then
do
/* signature may be a filename */
if(exists(sig)) then
do
call open(sigfh, sig, R)
do until eof(sigfh)
call writeln(tmp, readln(sigfh))
end
call close(sigfh)
end
else call writeln(tmp, sig) /* or just a string */
end
end
if(upper(AddSignature) = 'E') then
do
if(exists(SigFile)) then
do
call open(sigfh, SigFile, R)
do until eof(sigfh)
call writeln(tmp, readln(sigfh))
end
call close(sigfh)
end
else
do
call showerror('The configured signature file does not exist! Please correct this or turn off signature adding in IBMailTo.thor.')
call close(fh)
address command 'c:delete >NIL: 'tempfile''
exit
end
end
call close(tmp)
/* fill out some more variables that BBSREAD require */